﻿<UserControl x:Class="XamlHelpmeet.UI.Editors.DynamicFormTextBlockEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:cvtrs="clr-namespace:XamlHelpmeet.UI.Converters"
             xmlns:local="clr-namespace:XamlHelpmeet.UI.Editors">
    <UserControl.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <cvtrs:BindingModeEnumConverter x:Key="bindingModeEnumConverter" />

    </UserControl.Resources>

    <DockPanel Margin="3">
        <Grid DockPanel.Dock="Right">
            <ComboBox x:Name="cboStringFormat"
                      MaxWidth="117"
                      Focusable="False"
                      IsSynchronizedWithCurrentItem="True"
                      Loaded="cboStringFormat_Loaded"
                      SelectedValuePath="StringFormat">

                <ComboBox.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Margin="0,5,0,0"
                                           Background="AntiqueWhite"
                                           FontWeight="Bold"
                                           Padding="2,0,0,0"
                                           Text="{Binding Path=Name}" />
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                    </GroupStyle>
                </ComboBox.GroupStyle>
            </ComboBox>
            <TextBox Width="100"
                     Margin="0,0,17,0"
                     VerticalAlignment="Top"
                     TabIndex="2"
                     Text="{Binding Path=StringFormat,
                                    Mode=TwoWay,
                                    UpdateSourceTrigger=PropertyChanged}" />
        </Grid>
        <TextBlock Margin="0,0,10,0"
                   DockPanel.Dock="Right"
                   Text="Format" />
        <TextBlock Width="40" Text="Label" />
        <TextBox Width="125"
                 HorizontalAlignment="Left"
                 TabIndex="1"
                 Text="{Binding Path=AssociatedLabel,
                                Mode=TwoWay}" />
    </DockPanel>

</UserControl>
